package com.yangyang.ralearn.message;

import org.jboss.netty.channel.Channel;

import com.yangyang.ralearn.common.JEnvironment;
import com.yangyang.ralearn.net.message.AbstractMessage;
import com.yangyang.ralearn.net.message.AbstractReqMessage;
import com.yangyang.ralearn.net.serialize.AutoSerializable;
import com.yangyang.ralearn.server.JSimulator;
import com.yangyang.ralearn.server.ServerManager;

public class ReqNextProblemMessage extends AbstractReqMessage {

	@AutoSerializable(index = 1)
	private int groupId;

	@AutoSerializable(index = 2)
	private String problemFile;

	public void init(int groupId, String problemFile) {
		this.groupId = groupId;
		this.problemFile = problemFile;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onGetClientMessage(int groupId, int simulatorId, Channel channel) {
		// TODO Auto-generated method stub
		ServerManager.instance().nextProblem(groupId, simulatorId, problemFile);
	}

}
